import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-demo3',
  templateUrl: './demo3.component.html',
  styles: []
})
export class Demo3Component implements OnInit {
  constructor() {}

  ngOnInit() {}

  BeforeClose() {
    new Promise(resolve => {
      if (window.confirm('是否关闭?')) {
        resolve(true);
      }
    });
  }
}
